package com.linwen.excise.leetcode;

/**
 * @ClassName _2236判断根结点是否等于子结点之和
 * @Description TODO
 * @Author zero
 * @DATE 2024/9/22 1:27 AM
 * @Version 1.0
 */
public class _2236判断根结点是否等于子结点之和 {
    public static void main(String[] args) {
        _2236判断根结点是否等于子结点之和 inst = new _2236判断根结点是否等于子结点之和();
        TreeNode node = new TreeNode(10);
        node.left = new TreeNode(4);
        node.right = new TreeNode(6);
        System.out.println(inst.checkTree(node));

    }
    public boolean checkTree(TreeNode root) {
        return root.left.val + root.right.val == root.val;
    }
}
